const { postShareProfit } = require("../service/ice/sys");
const {
  testPartnerAddReceiver,
  testPartnerProfit,
  testAdd,
} = require("../service/test/test-partner");

const { testAdd2, testAdd1, testProfit } = require("../service/test/test-pay");

const { getPhoneNumber } = require("../service/third/mp");

const app = require("express").Router();

app.get("/", (req, res) => {
  res.send({
    query: req.query,
    hi: 1,
  });
});

app.post("/mp-phone", async (req, res) => {
  const data = await getPhoneNumber(req._body);
  res.send(data);
});

app.get("/profit-add", async (req, res) => {
  const data = await testAdd();
  res.send(data);
});
app.get("/add1", async (req, res) => {
  const data = await testAdd1(req.query);
  res.send(data);
});
app.get("/share2", async (req, res) => {
  const data = await testProfit();
  res.send(data);
});

app.get("/profit", async (req, res) => {
  const { sid = 0 } = req.query;
  const data = await postShareProfit(sid);
  res.send(data);
});

module.exports = app;
